add consumer group service method to SidecarHandle and associated loader utils#3261
add consumer group service method to SidecarHandle and associated loader utils#3261Dave Shoup (shouples) merged 4 commits intomainfrom
SidecarHandle and associated loader utils#3261Conversation
eefd751 to
ddae88c
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds foundational support for consumer groups in the VS Code extension by introducing a new service method and utility functions. It's part of a stacked PR series (PRs #3261-3264) building toward displaying consumer groups in the Topics view.
Changes:
- Adds
getConsumerGroupV3Apimethod toSidecarHandlefor creating consumer group API clients - Adds
fetchConsumerGroupsutility function to fetch all consumer groups for a Kafka cluster - Adds
fetchConsumerGroupMembersutility function to fetch members/consumers of a specific consumer group - Includes comprehensive unit tests for the new utility functions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/sidecar/sidecarHandle.ts |
Adds getConsumerGroupV3Api service method following the exact pattern of similar methods like getTopicV3Api and getPartitionV3Api |
src/loaders/utils/loaderUtils.ts |
Implements fetchConsumerGroups and fetchConsumerGroupMembers utility functions with proper logging, following patterns established by fetchSubjects |
src/loaders/utils/loaderUtils.test.ts |
Adds comprehensive test coverage for both new utility functions, including happy path and empty result edge cases |
| createTestTopicData(TEST_LOCAL_KAFKA_CLUSTER.id, "topic3", ["READ", "WRITE"]), | ||
| createTestTopicData(TEST_LOCAL_KAFKA_CLUSTER.id, "topic4", ["READ", "WRITE"]), | ||
| ]; | ||
| // required for ConsumerGroupData/ConsumerGroupDataList but will be unused in the associated tests |
| }); | ||
|
|
||
| it("should return a ConsumerGroupData array from listKafkaConsumerGroups", async () => { | ||
| const testGroups: ConsumerGroupData[] = [ |
There was a problem hiding this comment.
nit: move this and testConsumers to describe block in anticipation of more tests.
There was a problem hiding this comment.
I thought about it, but we just have the two tests per helper function (one with data, one with no data). We'll definitely reuse some of the internal models for consumer groups and need to set those in the describe blocks of future branches' tests, but for now there aren't any other tests that need 'em. If we do get to that point, should be easy enough in any future branch to promote these to the describe-block level.
|




Summary of Changes
No functional changes here, just prep work for downstream branches.
Note that the new
fetchConsumerGroup*()functions aren't actually used until #3264, but were included since they are the only (initial) callers to the newgetConsumerGroupV3Apiservice method.Closes #3228, closes #3229
Associated PRs
SidecarHandleand associated loader utils #3261 👈Pull request checklist
Please check if your PR fulfills the following (if applicable):
Tests
Release notes